#include <iostream>
#include <vector>
#include <unistd.h>
#include "Pthread.hpp"
#include "LogMessage.hpp"

void Print(std::string name)
{
    std::cout << name << std::endl;
}

int main()
{
    std::vector<Thread<std::string>> _threads;
    for (int i = 0; i < 5; i++)
    {
        std::string thread_name = GetPthreadName();
        _threads.push_back(Thread<std::string>(thread_name, std::bind(&Print, std::placeholders::_1), thread_name));
        lg.LogMessage(Debug, "create %s success", thread_name.c_str());
    }

    for (auto e : _threads)
    {
        e.Start();
    }

    for (auto e : _threads)
    {
        e.Join();
    }


    return 0;
}